class FileUtil:
    """
    文件工具类
    """
    @staticmethod
    def open_file_dialog(parent=None, title="打开文件", directory="", filter="All Files (*.*)"):
        """
        打开文件对话框
        :param parent: 父窗口
        :param title: 对话框标题
        :param directory: 初始目录
        :param filter: 文件过滤器
        :return: 选择的文件路径
        """
        from PySide6.QtWidgets import QFileDialog
        file_path, _ = QFileDialog.getOpenFileName(
            parent=parent,
            caption=title,
            dir=directory,
            filter=filter
        )
        return file_path